<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <div id="app">
            <h2>当前计数：{{num}}</h2>
            <button @click="increment">+</button>
            <button @click="subtraction">-</button>
        </div>
        <script src="../js/vue.js"></script>
        <script>
            const app = new Vue({
                el: '#app',
                data: {
                    num: 0
                },
                methods: {
                    increment: function() {
                        this.num++
                    },
                    subtraction: function() {
                        this.num--
                    }
                },
            })
        </script>
    </body>
</html>